#pragma once
#include <string>
#include <map>
#include "IniSection.h"
/**
* This class provides access to the contents of an ini file.
* @author Koen Samyn
*/
class IniFile
{
public:
	/**
	* Creates a new IniFile object.
	*/
	IniFile(void);
	/**
	* Destroys the IniFile object.
	*/
	virtual ~IniFile(void);
	/**
	* Adds an Ini Section
	* @param the IniSection object to add.
	*/
	void AddIniSection(IniSection* iniSection);
	/**
	* Gets the value in a section for a specific key.
	* @param sectionName the name for the section.
	* @param keyName the name of the key in the section.
	*/
	const tstring& GetValue(tstring sectionName, tstring keyName) const;
	/**
	* Sets the value in a section for a specific key.
	* @param sectionName the name for the section.
	* @param keyName the namve for the key.
	*/
	void SetValue(tstring sectionName, tstring keyName,tstring value);

	/**
	* Checks if a value is present for the given section and keyname.
	* @param sectionName the name for the section.
	* @param keyName the key name.
	* @return true if the key is present, false otherwise.
	*/
	bool HasValue( tstring sectionName, tstring keyName) const;
private:
	map<tstring,IniSection*> m_IniSectionMap;
};
